using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._GeodatabaseAdministration
{
    /// <summary>
    /// <para>Analyze Datasets</para>
    /// <para>Updates database statistics of base tables, delta tables, and archive tables, along with the statistics on the indexes of those tables. This tool is used in enterprise geodatabases to help get optimal performance from the RDBMS query optimizer. Stale statistics can affect geodatabase performance.</para>
    /// <para>更新基表、增量表和存档表的数据库统计信息，以及这些表的索引统计信息。此工具用于企业级地理数据库，以帮助从 RDBMS 查询优化器获得最佳性能。过时的统计数据可能会影响地理数据库的性能。</para>
    /// </summary>    
    [DisplayName("Analyze Datasets")]
    public class AnalyzeDatasets : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public AnalyzeDatasets()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_input_database">
        /// <para>Input Database Connection</para>
        /// <para>The database that contains the data to be analyzed.</para>
        /// <para>包含要分析的数据的数据库。</para>
        /// </param>
        /// <param name="_include_system">
        /// <para>Include System Tables</para>
        /// <para><xdoc>
        ///   <para>Specifies whether statistics will be gathered on the states and state lineages tables.</para>
        ///   <bulletList>
        ///     <bullet_item>Unchecked—Statistics will not be gathered on the states and state lineages tables. This is the default.</bullet_item><para/>
        ///     <bullet_item>Checked—Statistics will be gathered on the states and state lineages tables.
        ///     <para>You must be the geodatabase administrator for this option to be active.</para>
        ///     <para>This option only applies to geodatabases. If the input workspace is a database, this option will be inactive.</para>
        ///     </bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否收集有关状态和状态世系表的统计信息。</para>
        ///   <bulletList>
        ///     <bullet_item>未选中—不会在州和州世系表上收集统计数据。这是默认设置。</bullet_item><para/>
        /// <bullet_item>选中—将在州和州世系表上收集统计数据。
        ///     <para>您必须是地理数据库管理员，此选项才能处于活动状态。</para>
        ///     <para>此选项仅适用于地理数据库。如果输入工作区是数据库，则此选项将处于非活动状态。</para>
        ///     </bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        public AnalyzeDatasets(object _input_database, _include_system_value _include_system)
        {
            this._input_database = _input_database;
            this._include_system = _include_system;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Analyze Datasets";

        public override string CallName => "management.AnalyzeDatasets";

        public override List<string> AcceptEnvironments => ["workspace"];

        public override object[] ParameterInfo => [_input_database, _include_system.GetGPValue(), _in_datasets, _analyze_base.GetGPValue(), _analyze_delta.GetGPValue(), _analyze_archive.GetGPValue(), _out_workspace];

        /// <summary>
        /// <para>Input Database Connection</para>
        /// <para>The database that contains the data to be analyzed.</para>
        /// <para>包含要分析的数据的数据库。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Database Connection")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _input_database { get; set; }


        /// <summary>
        /// <para>Include System Tables</para>
        /// <para><xdoc>
        ///   <para>Specifies whether statistics will be gathered on the states and state lineages tables.</para>
        ///   <bulletList>
        ///     <bullet_item>Unchecked—Statistics will not be gathered on the states and state lineages tables. This is the default.</bullet_item><para/>
        ///     <bullet_item>Checked—Statistics will be gathered on the states and state lineages tables.
        ///     <para>You must be the geodatabase administrator for this option to be active.</para>
        ///     <para>This option only applies to geodatabases. If the input workspace is a database, this option will be inactive.</para>
        ///     </bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否收集有关状态和状态世系表的统计信息。</para>
        ///   <bulletList>
        ///     <bullet_item>未选中—不会在州和州世系表上收集统计数据。这是默认设置。</bullet_item><para/>
        /// <bullet_item>选中—将在州和州世系表上收集统计数据。
        ///     <para>您必须是地理数据库管理员，此选项才能处于活动状态。</para>
        ///     <para>此选项仅适用于地理数据库。如果输入工作区是数据库，则此选项将处于非活动状态。</para>
        ///     </bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Include System Tables")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _include_system_value _include_system { get; set; }

        public enum _include_system_value
        {
            /// <summary>
            /// <para>SYSTEM</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("SYSTEM")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_SYSTEM</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_SYSTEM")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Datasets to Analyze</para>
        /// <para>The names of the datasets that will be analyzed. Only datasets that are owned by the connected user will be displayed.</para>
        /// <para>将要分析的数据集的名称。仅显示已连接用户拥有的数据集。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Datasets to Analyze")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _in_datasets { get; set; } = null;


        /// <summary>
        /// <para>Analyze Base Tables for Selected Dataset(s)</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the selected dataset base tables will be analyzed.</para>
        ///   <para>This option only applies to geodatabases. If the input workspace is a database, this option will be inactive.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—Statistics will be gathered for the base tables for the selected datasets. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—Statistics will not be gathered for the base tables for the selected datasets.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否分析选定的数据集基表。</para>
        ///   <para>此选项仅适用于地理数据库。如果输入工作区是数据库，则此选项将处于非活动状态。</para>
        ///   <bulletList>
        ///     <bullet_item>选中—将收集所选数据集的基表的统计数据。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 - 不会收集所选数据集的基表的统计数据。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Analyze Base Tables for Selected Dataset(s)")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _analyze_base_value _analyze_base { get; set; } = _analyze_base_value._true;

        public enum _analyze_base_value
        {
            /// <summary>
            /// <para>ANALYZE_BASE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("ANALYZE_BASE")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_ANALYZE_BASE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_ANALYZE_BASE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Analyze Delta Tables for Selected Dataset(s)</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the selected dataset delta tables will be analyzed.</para>
        ///   <para>This option only applies to geodatabases that contain traditional versions. If the input workspace is a database, this option will be inactive.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—Statistics will be gathered for the delta tables for the selected datasets. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—Statistics will not be gathered for the delta tables for the selected datasets.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否分析所选数据集增量表。</para>
        ///   <para>此选项仅适用于包含传统版本的地理数据库。如果输入工作区是数据库，则此选项将处于非活动状态。</para>
        ///   <bulletList>
        ///     <bullet_item>选中—将收集所选数据集的增量表的统计数据。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 - 不会收集所选数据集的增量表的统计数据。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Analyze Delta Tables for Selected Dataset(s)")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _analyze_delta_value _analyze_delta { get; set; } = _analyze_delta_value._true;

        public enum _analyze_delta_value
        {
            /// <summary>
            /// <para>ANALYZE_DELTA</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("ANALYZE_DELTA")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_ANALYZE_DELTA</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_ANALYZE_DELTA")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Analyze Archive Tables for Selected Dataset(s)</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the selected dataset archive tables will be analyzed.</para>
        ///   <para>This option only applies to geodatabases that contain archive-enabled datasets. If the input workspace is a database, this option will be inactive.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—Statistics will be gathered for the archive tables for the selected datasets. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—Statistics will not be gathered for the archive tables for the selected datasets.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否分析所选数据集存档表。</para>
        ///   <para>此选项仅适用于包含启用存档的数据集的地理数据库。如果输入工作区是数据库，则此选项将处于非活动状态。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 将收集所选数据集的存档表的统计数据。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中—将不收集所选数据集的存档表的统计数据。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Analyze Archive Tables for Selected Dataset(s)")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _analyze_archive_value _analyze_archive { get; set; } = _analyze_archive_value._true;

        public enum _analyze_archive_value
        {
            /// <summary>
            /// <para>ANALYZE_ARCHIVE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("ANALYZE_ARCHIVE")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_ANALYZE_ARCHIVE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_ANALYZE_ARCHIVE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Updated Workspace</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Updated Workspace")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_workspace { get; set; }


        public AnalyzeDatasets SetEnv(object workspace = null)
        {
            base.SetEnv(workspace: workspace);
            return this;
        }

    }

}